<template>
	<f-popup ref="popup" position="bottom">
		<view class="content">
			<view class="head-title">{{info.title}}</view>
			<scroll-view scroll-y class="scroll">
				<view class="lists">
					<view class="item" v-for="(item, index) in info.list" :key="index">
						<view class="flex align-center">
							<image v-if="item.icon" :src="item.icon" class="icon"></image>
							<view class="title">{{item.title}}</view>
						</view>
						<view class="desc">{{item.desc}}</view>
					</view>
				</view>
			</scroll-view>
			
			<view class="footer-btns">
				<button class="confirm-btn flex-1" @click="close">完成</button>
			</view>
		</view>
	</f-popup>
</template>

<script>
	export default {
		data() {
			return {
				info: {}
			};
		},
		onReady() {
			
		},
		methods: {
			open(info) {
				this.info = info
				console.log('info', this.info);
				this.$refs.popup.open();
			},
			close() {
				this.$refs.popup.close();
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;
		background-color: #FFFFFF;
		border-top-left-radius: 26rpx;
		border-top-right-radius: 26rpx;
	}
	
	.head-title {
		font-size: 34rpx;
		font-weight: 600;
		line-height: 46rpx;
		text-align: center;
		color: #000000;
		padding: 32rpx;
	}
	
	.scroll {
		width: 100%;
		height: 60vh;
		box-sizing: border-box;
		padding: 0 40rpx;
		
		.lists {
			display: flex;
			flex-direction: column;
			gap: 52rpx;
			
			.icon {
				width: 32rpx;
				height: 32rpx;
				margin-right: 16rpx;
				vertical-align: bottom;
				
				image {
					width: 100%;
					height: 100%;
				}
			}
			
			.title {
				font-size: 28rpx;
				font-weight: 500;
				line-height: 46rpx;
				color: #000000;
			}
			
			.desc {
				color: #666666;
				font-size: 24rpx;
				font-weight: 400;
				line-height: 34rpx;
				padding-top: 12rpx;
			}
		}
	}
	
	.footer-btns {
		// position: fixed;
		// left: 0;
		// right: 0;
		// bottom: 0;
		width: 100%;
		// z-index: 999;
		padding: 20rpx 32rpx;
		box-sizing: border-box;
		background-color: #FFFFFF;
		box-shadow: 0px 0px 33rpx rgba(0, 0, 0, 0.05);
		padding-bottom: calc(20rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		padding-bottom: calc(20rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
		
		display: flex;
		align-items: center;
		gap: 80rpx;
	}
</style>
